package Offer;

/*
* 旋转数组的最小数字
*
*   m只能跟j比较, 在数组旋转0次也就是有序的时候,跟i比较计算不出来
*   nums[m]==nums[j]是无法判断,此时j--;
* */
public class Offer11minArray {
    public int minArray(int[] numbers) {
        int height=numbers.length-1;
        int low=0;
        int mid;
        while(low<height){
            mid=low+(height-low)/2;
            if(numbers[height]<numbers[mid]){
                low=mid+1;
            }else if(numbers[height]>numbers[mid]){
                height=mid;
            }else{
                height--;
            }
        }
        return numbers[low];
    }
}
